package com.example.tool.bean.wcaiexcel;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class GetSmartSheetRecordsResponse extends WeComApiResponse{
    @JsonProperty("total")
    private Integer total;
    @JsonProperty("has_more")
    private Boolean hasMore;
    @JsonProperty("next")
    private Integer next;
    @JsonProperty("records")
    private List<Record> records=new ArrayList<>();
    @JsonProperty("ver")
    private Integer ver;
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
public static class Record {
    @JsonProperty("record_id")
    private String recordId;
    @JsonProperty("create_time")
    private String createTime;
    @JsonProperty("updateTime")
    private String updateTime;
    @JsonProperty("values")
    private Object values; // 实际使用时需要根据key_type转换为Map<String, Object>
    @JsonProperty("creator_name")
    private String creatorName;
    @JsonProperty("updater_name")
    private String updaterName;
}
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
public static class CellTextValue {
    @JsonProperty("type")
    private String type;
    @JsonProperty("text")
    private String text;
    @JsonProperty("link")
    private String link;
}
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
public static class CellImageValue {
    @JsonProperty("id")
    private String id;
    @JsonProperty("title")
    private String title;
    @JsonProperty("image_url")
    private String imageUrl;
    @JsonProperty("width")
    private Integer width;
    @JsonProperty("height")
    private Integer height;
}
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
public static class CellAttachmentValue {
    @JsonProperty("doc_type")
    private String docType;
    @JsonProperty("file_ext")
    private String fileExt;
    @JsonProperty("file_type")
    private String fileType;
    @JsonProperty("file_url")
    private String fileUrl;
    @JsonProperty("name")
    private String name;
    @JsonProperty("size")
    private Integer size;
}
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
public static class CellUserValue {
    @JsonProperty("user_id")
    private String userId;
    @JsonProperty("tmp_external_userid")
    private String tmpExternalUserid;
}
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
public static class CellUrlValue {
    private String type;
    private String text;
    private String link;
}
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
public static class Option {
    private String id;
    private Integer style;
    private String text;
}
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
public static class CellLocationValue {
   @JsonProperty("source_type")
    private Integer sourceType;
    private String id;
    private String latitude;
    private String longitude;
    private String title;
}
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
public static class CellAutoNumberValue {
    private String seq;
    private String text;
 }
}
